package com.apobates.jforum2.troll.forum.entity;

import java.io.Serializable;
import java.util.Optional;
import java.util.TreeSet;

/**
 * 复合查询的组合对象
 * @author xiaofanku
 */
public class BoardGroupGraph implements Serializable{
    private final BoardGroup boardGroup;
    private final int ranking;
    //组下的版块
    private TreeSet<Board> boardes = new TreeSet<>();
    
    public BoardGroupGraph(BoardGroup boardGroup) {
        this.boardGroup = boardGroup;
        this.ranking = Optional.ofNullable(boardGroup).map(BoardGroup::getRanking).orElse(0);
    }

    public BoardGroup getBoardGroup() {
        return boardGroup;
    }

    public TreeSet<Board> getBoardes() {
        return boardes;
    }

    public void setBoardes(TreeSet<Board> boardes) {
        this.boardes = boardes;
    }

    public int getRanking() {
        return ranking;
    }
}